From a7dd5f6d726a16455a9b02bfbb17c1d4a3459846 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Tue, 16 Jan 2018 18:34:46 +0100 Subject: [PATCH] babl: set user_data ptr for quick dispatch of 1 step path --- babl/babl-fish-path.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index 8f60449..867cb8d 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -704,6 +704,7 @@ _babl_fish_rig_dispatch (Babl *babl) /* do same short-circuit optimization as for simple fishes */ babl->fish.dispatch = conversion->dispatch; + babl->fish.data = &conversion->data; } else { @@ -822,11 +823,8 @@ process_conversion_path (BablList *path, long c = MIN (n - j, MAX_BUFFER_SIZE); int i; - /* this is where the loop unrolling should happen */ void *aux1_buffer = temp_buffer; - void *aux2_buffer = NULL; - void *swap_buffer = NULL; - aux2_buffer = temp_buffer2; + void *aux2_buffer = temp_buffer2; /* The first conversion goes from source_buffer to aux1_buffer */ babl_conversion_process (babl_list_get_first (path), @@ -843,10 +841,12 @@ process_conversion_path (BablList *path, aux1_buffer, aux2_buffer, c); - /* Swap the auxiliary buffers */ - swap_buffer = aux1_buffer; - aux1_buffer = aux2_buffer; - aux2_buffer = swap_buffer; + { + /* Swap the auxiliary buffers */ + void *swap_buffer = aux1_buffer; + aux1_buffer = aux2_buffer; + aux2_buffer = swap_buffer; + } } /* The last conversion goes from aux1_buffer to destination_buffer */ @@ -1007,7 +1007,7 @@ get_path_instrumentation (FishPathInstrumentation *fpi, *path_error = babl_rel_avg_error (fpi->destination_rgba_double, fpi->ref_destination_rgba_double, - fpi->num_test_pixels * 4); + fpi->num_test_pixels * 4); *ref_cost = fpi->reference_cost; } -- 2.30.2